<?php
use \tpfcore\Core;
?>
<!doctype html>
<head>
        <meta charset="utf-8">
        <!-- Set render engine for 360 browser -->
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- HTML5 shim for IE8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js">
            </script>
        <![endif]-->
        <link href="{$admin_assets_path}/css/theme.min.css" rel="stylesheet">
        <link href="{$admin_assets_path}/css/simplebootadmin.css" rel="stylesheet">
        <link href="{$admin_assets_path}/css/default.css" rel="stylesheet" />
        <link href="{$admin_assets_path}/css/font-awesome.min.css" rel="stylesheet" type="text/css">
        <style>
            .length_3{width: 180px;} form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
            .table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;} .table-list{margin-bottom:
            0px;}
        </style>
        <!--[if IE 7]>
            <link rel="stylesheet" href="{$admin_assets_path}/css/font-awesome-ie7.min.css">
        <![endif]-->
        <script type="text/javascript">
            //全局变量
            var GV = {
                WEB_ROOT:"",
                DIMAUB: "/",
                JS_ROOT: "/theme/backend/assets/js/",
                TOKEN: ""
            };
        </script>
        <!-- Le javascript==================================================-
        -> <!-- Placed at the end of the document so the pages load faster -->
        <script src="{$admin_assets_path}/js/jquery.js"></script>
        <script src="{$admin_assets_path}/js/wind.js"></script>
        <script src="{$admin_assets_path}/js/bootstrap.min.js"></script>
        <script src="{$admin_assets_path}/kindeditor/kindeditor-min.js"></script>
        <link href="{$admin_assets_path}/kindeditor/themes/default/default.css" rel="stylesheet"/>
        <style type="text/css">.btn{padding:2px 8px; font-size: 14px;}</style>
    </head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('mall/Order/index')}">订单管理</a></li>
    </ul>
    <form class="well form-search" method="get" action="">
        订单状态：
        <select name="order_status" class="selector" style="width:100px;">
            <option value="">全部</option>
            <option value="0" {present name="search.order_status"}{eq name="search.order_status" value="0"}selected{/eq}{/present}>未付款</option>
            <option value="1" {present name="search.order_status"}{eq name="search.order_status" value="1"}selected{/eq}{/present}>已付款</option>
            <option value="2" {present name="search.order_status"}{eq name="search.order_status" value="2"}selected{/eq}{/present}>已取消</option>
            <option value="3" {present name="$search.order_status"}{eq name="search.order_status" value="3"}selected{/eq}{/present}>已发货</option>
            <option value="4" {present name="$search.order_status"}{eq name="search.order_status" value="4"}selected{/eq}{/present}>已退货</option>
        </select> &nbsp;&nbsp;
        支付状态：
        <select name="pay_status" class="selector" style="width:100px;">
            <option value="">全部</option>
            <option value="0" {present name="$search.pay_status"}{eq name="search.pay_status" value="0"}selected{/eq}{/present}>未付款</option>
            <option value="1" {present name="$search.pay_status"}{eq name="search.pay_status" value="1"}selected{/eq}{/present}>已付款</option>
            <option value="4" {present name="$search.pay_status"}{eq name="search.pay_status" value="4"}selected{/eq}{/present}>付款取消</option>
        </select> &nbsp;&nbsp;
        发货状态：
        <select name="shipping_status" class="selector" style="width:100px;">
            <option value="">全部</option>
            <option value="0" {present name="$search.shipping_status"}{eq name="search.shipping_status" value="0"}selected{/eq}{/present}>未发货</option>
            <option value="1" {present name="$search.shipping_status"}{eq name="search.shipping_status" value="1"}selected{/eq}{/present}>配货中</option>
            <option value="2" {present name="$search.shipping_status"}{eq name="search.shipping_status" value="2"}selected{/eq}{/present}>已发货</option>
            <option value="3" {present name="$search.shipping_status"}{eq name="search.shipping_status" value="3"}selected{/eq}{/present}>已收货</option>
        </select> &nbsp;&nbsp;
        支付方式：
        <select name="pay_way" class="selector" style="width:100px;">
            <option value="">全部</option>
            <option value="wechat" {present name="$search.pay_way"}{eq name="search.pay_way" value="wechat"}selected{/eq}{/present}>微信</option>
            <option value="alipay" {present name="$search.pay_way"}{eq name="search.pay_way" value="alipay"}selected{/eq}{/present}>支付宝</option>
            <option value="bankcard" {present name="$search.pay_way"}{eq name="search.pay_way" value="bankcard"}selected{/eq}{/present}>银行卡</option>
        </select> &nbsp;&nbsp;
        下单时间段：
        <input type="text" name="start_time" class="js-datetime date" value="{$search.start_time|default=''}" style="width: 120px;" autocomplete="off">-
        <input type="text" class="js-datetime date" name="end_time" value="{$search.end_time|default=''}" style="width: 120px;" autocomplete="off"> &nbsp; &nbsp;
        订单号： 
        <input type="text" name="order_sn" style="width: 200px;" value="{$search.order_sn|default=''}" placeholder="订单号">
        <input type="submit" class="btn btn-primary" value="搜索">
    </form>
    <form method="post" class="js-ajax-form" action="term/listorders">
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th width="50">订单号</th>
                    <th>总金额</th>
                    <th>实际金额</th>
                    <th>订单状态</th>
                    <th>支付状态</th>
                    <th>发货状态</th>
                    <th>支付方式</th>
                    <th>下单时间</th>
                    <th>支付时间</th>
                    <th width="140">操作</th>
                </tr>
            </thead>
            <tbody>
                {empty name="list"}
                <tr><td colspan="10">没有数据</td></tr>
                {else/}
                {foreach name="list" item="vo"}
                <tr>
                    <td>{$vo.order_sn}</td>
                    <td>{$vo.goods_price}</td>
                    <td>{$vo.order_amount}</td>
                    <td>
                        {if condition="$vo.order_status eq 0"}未付款{/if}
                        {if condition="$vo.order_status eq 1"}已付款{/if}
                        {if condition="$vo.order_status eq 2"}已取消{/if}
                        {if condition="$vo.order_status eq 3"}已发货{/if}
                        {if condition="$vo.order_status eq 4"}已退货{/if}
                    </td>
                    <td>
                        {if condition="$vo.pay_status eq 0"}未付款{/if}
                        {if condition="$vo.pay_status eq 1"}已付款{/if}
                        {if condition="$vo.pay_status eq 4"}已取消{/if}
                    </td>
                    <td>
                        {if condition="$vo.shipping_status eq 0"}未发货{/if}
                        {if condition="$vo.shipping_status eq 1"}配货中{/if}
                        {if condition="$vo.shipping_status eq 2"}已发货{/if}
                        {if condition="$vo.shipping_status eq 3"}已收货{/if}
                    </td>
                    <td>{$vo.pay_name}</td>
                    <td>{$vo.add_time|date='Y-m-d H:i:s',###}</td>
                    <td>
                        {if condition="$vo.pay_status eq 1"}
                        {$vo.pay_time|date='Y-m-d H:i:s',###}
                        {else/}
                        ----
                        {/if}
                    </td>
                    <td>
                        <a href="{:url('mall/Order/info',['id'=>$vo['id']])}">查看订单详情</a>
                    </td>
                </tr>
                {/foreach}
                {/empty}
            </tbody>
        </table>
    </form>
    <div class="pagination text-center">{$list->render()}</div>
</div>
<script src="{$admin_assets_path}/js/common.js"></script>
</body>
</html>